package org.freetek.linkdn.activity.alert;

import org.freetek.linkdn.LinkdnActivity;
import org.freetek.linkdn.R;

import android.os.Bundle;
import android.widget.TextView;

public class AlertActivity extends LinkdnActivity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.alert);
		
		TextView tvText = (TextView) findViewById(R.id.tvAlertText);
		tvText.setText(getMsg());
	}

	private String getMsg() {
		Bundle result = getExtras();
		
		if (!result.containsKey(AlertBundleKeys.MESSAGE)) {
			throw new IllegalArgumentException("extras bundle does not contain " + AlertBundleKeys.MESSAGE + " key");
		}
		return result.getString(AlertBundleKeys.MESSAGE);
	}
}
